package com.lemontree.common.baseEnum;

/**
 * Created by YLBG-YCY-1325 on 2017/2/18.
 */
public enum ResCode {
    OK(200,"成功"),
    FAIL(0,"失败"),
    SERVICE_ERROR(500,"服务器发生未知错误"),
    INVALID_ARG(400, "请求参数有误"),

    //注册信息
    REG_PHONE_EXIST(101,"该号码已被注册"),
    REG_USERNAME_EXIST(102,"该用户名已被使用"),

    //邮箱信息
    EMAIL_CODE_TIME_IN(201,"60秒内请勿重复发送"),
    INVALID_EMAIL_CODE(202,"无效的邮箱验证码"),
    ERROR_EMAIL_CODE(203,"错误的邮箱验证码"),
    ERROR_EMAIL(204,"错误邮箱"),
    EMAIL_SEND_SUCCESS(205,"邮箱发送成功"),

    //session
    INVALID_SESSION(301,"session失效"),

    //登录信息
    LOGIN_FAIL(401,"用户名或密码错误");

    private Integer retCode;
    private String desc;

    private ResCode(Integer code,String description){
        this.retCode = code;
        this.desc = description;
    }

    public Integer getRetCode() {
        return retCode;
    }

    public void setRetCode(Integer retCode) {
        this.retCode = retCode;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
